from django.conf.urls.defaults import *
from instafeed.subscriptions.views import notifyUpdate, subscribe, dashboard,\
    new_feed, delete_feed, edit_feed, xmlrpc_feed
from instafeed.subscriptions.views import new_cloudserver, edit_cloudserver,\
    delete_cloudserver, ping_cloudserver, help_cloudserver, subscribe_to_cloudserver,\
    feed_cloudserver, web_cloudserver, xmlrpc_cloudserver
from instafeed.conduits.views import manage_conduits, new_conduit, delete_conduit

# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Example:
    ("^notifyUpdate/(\d+)$", notifyUpdate),
    ("^subscribe/(\d+)$", subscribe),
    ("^$", dashboard),
    ("^dashboard/$", dashboard),
    ("^new_feed/$", new_feed),
    ("^delete_feed/(\d+)$", delete_feed),
    ("^edit_feed/(\d+)/$", edit_feed),
    url(r'^xmlrpc_feed/(\d+)$',  xmlrpc_feed, name='xmlrpc_feed'),

    ("^manage_conduits/$", manage_conduits),
    url("^new_conduit/$", new_conduit, name="instafeed_new_conduit"),
    ("^delete_conduit/(\d+)$", delete_conduit),
    # (r'^instafeed/', include('instafeed.foo.urls')),

    # Uncomment the admin/doc line below and add 'django.contrib.admindocs'
    # to INSTALLED_APPS to enable admin documentation:
    # (r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    (r'^admin/', include(admin.site.urls)),
    (r'^accounts/', include('socialauth.urls')),
    (r'^conduits/', include('instafeed.conduits.urls')),
)

#Cloud servers urls
urlpatterns += patterns('',
    (r'^new_cloudserver/$',             new_cloudserver),
    (r'^edit_cloudserver/(\d+)$',       edit_cloudserver),
    (r'^delete_cloudserver/(\d+)$',     delete_cloudserver),
    url(r'^ping_cloudserver/(\d+)$',    ping_cloudserver,   name='ping_cloudserver'),
    url(r'^help_cloudserver/(\d+)$',    help_cloudserver,   name='help_cloudserver'),
    url(r'^subscribe_to_cloudserver/(\d+)$', subscribe_to_cloudserver, name='subscribe_to_cloudserver'),
    url(r'^feed_cloudserver/(\d+)$',    feed_cloudserver,   name='feed_cloudserver'),
    url(r'^web_cloudserver/(\d+)$',     web_cloudserver,    name='web_cloudserver'),
    url(r'^xmlrpc_cloudserver/(\d+)$',  xmlrpc_cloudserver, name='xmlrpc_cloudserver'),
)
